package reading.common;

import org.springframework.validation.Errors;

import java.util.stream.Collectors;

/**
 * @author jing.yang
 */
public class ErrorsUtils {

    public static String toString(Errors errors) {
        return errors.getFieldErrors().stream().map(item -> item.getField() + " " + item.getDefaultMessage()).collect(Collectors.joining("；"));
    }

}
